// /* You can add global styles to this file, and also import other style files */

/* 通用Flex布局 */
.mt-flex {
  display: flex;
  overflow: hidden;
}

// 垂直Flex布局（需要自己设定高度，大部分情况是height: 100%;）
.mt-flex-column {
  .mt-flex;

  flex-direction: column;
  width: 100%;
}

// 水平Flex布局（需要自己设定宽度，大部分情况是width: 100%;）
.mt-flex-row {
  .mt-flex;

  flex-direction: row;
  height: 100%;
}

/* angular-split页面布局 */
.button-area {
  margin: 10px;
  margin-top: 13px !important;
  margin-bottom: 0 !important;
}

.form-area {
  width: 98.5% !important;
  margin-top: 10px;
  margin-bottom: 15px;
  margin-left: 10px;
  background: white;

  .form-area-btn>.first-btn {
    margin-top: 4px;
  }

  .form-area-btn>.second-btn {
    margin-top: 8px;
  }
}

.matech-toolbar {
  margin-top: 10px;
  padding: 0 0 0 0;
}

// ST表格内边距
@st-padding: 10px;

/* ST表格 */
.st {
  height: 100%;
}

// 表单中的表格调整
form>nz-table {
  margin-left: -10px;
}

/* 通用nz表格 */
nz-table {
  height: 100%;
  padding: 0 @st-padding @st-padding @st-padding;

  // 表格内按钮
  .ant-btn,
  .ant-btn:active,
  .ant-btn:focus {
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 14px !important;
    border-radius: 4px !important;
  }

  // 表格重新按flex布局
  nz-spin {
    height: 100%;

    .ant-spin-container {
      .mt-flex-column;

      height: 100%;

      // 表格
      .ant-table {
        flex: 1 1 auto;
        order: 1;
        height: 150px;
        .mt-flex-column;

        .ant-table-content {
          flex: 1 1 auto;
          height: 130px;
        }

        // 继续向下flex
        .ant-table-scroll {
          .mt-flex-column;

          height: 100%;

          // 表头
          .ant-table-header {
            flex: none;
            order: 1;
            // overflow: hidden;
            // margin-bottom: 0 !important;
          }

          // 内容(最终需要它动态滚动)
          .ant-table-body {
            flex: 1 1 auto;
            order: 2;
            height: 100px;
          }

          // 没有数据时的占位图标
          .ant-table-placeholder {
            flex: 1 1 auto;
            order: 3;
            border-top: 0;
          }
        }
      }

      // 分页栏
      nz-pagination {
        order: 2;

        .ant-table-pagination.ant-pagination {
          margin-bottom: 0;
        }
      }
    }
  }


  // 设置字体大小，背景颜色，文字颜色，加粗，隐藏滚动条等
  .ant-table-header,
  .ant-table-body {
    .ant-table-th-right-sticky {
      background-color: #e5edf6 !important;
    }

    .ant-table-fixed {
      overflow-x: hidden !important;
    }

    .ant-table-thead>tr>th {
      color: #1b1b1b;
      font-weight: bold;
      font-size: 14px;
      background-color: #e5edf6 !important;
    }
  }

  // 紧凑行
  .ant-table-content>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-scroll>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-scroll>.ant-table-body>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-left>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-right>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-left>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-right>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-body>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-scroll>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-scroll>.ant-table-body>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-left>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-right>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-left>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-right>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-tbody>tr>td {
    padding: 5px 8px !important;
  }

  // 选中行样式
  .ant-table-thead>tr.ant-table-row-hover:not(.ant-table-expanded-row)>td,
  .ant-table-tbody>tr.ant-table-row-hover:not(.ant-table-expanded-row)>td,
  .ant-table-thead>tr:hover:not(.ant-table-expanded-row)>td,
  .ant-table-tbody>tr:hover:not(.ant-table-expanded-row)>td {
    color: @primary-color;
    background: tint(@primary-color, 96%);
  }
}

/* 弹窗下的表格 */
.ant-modal-body>nz-table,
.ant-modal-body>*>nz-table {
  padding: 0;

  .ant-table {
    height: 100%;

    .ant-table-content {
      height: 100%;

      .ant-table-body {
        height: 100%;
      }
    }
  }
}


.as-split-area {
  height: 655px;

  >.sider-trigger {
    bottom: 0;
    width: 100%;
    height: 42px;
    color: #002140;
    line-height: 42px;
    text-align: center;
    background: #fafafa;
    border: 1px solid #fafafa;
    cursor: pointer;
    transition: all 0.2s;
  }
}

.as-split-area.flex-fixed {
  flex: none !important;
  height: auto;
  overflow: hidden !important;
}

.alain-default__content>router-outlet+* {
  flex: 1 1 auto;
  height: 100px;
}

.search-row {
  height: 52px;
}

// 英文汉字不换行引发的错行
.ant-table-small>.ant-table-content>.ant-table-scroll>.ant-table-header>table,
.ant-table-small>.ant-table-content>.ant-table-scroll>.ant-table-body>table,
.ant-table-small>.ant-table-content>.ant-table-scroll>.ant-table-body>.cdk-virtual-scroll-content-wrapper>table,
.ant-table-bordered.ant-table-fixed-header .ant-table-header+.ant-table-body>table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}


// 覆盖之前设置的表头，上下边距增加4px
nz-table .ant-table-content>.ant-table-scroll>.ant-table-header>table>.ant-table-thead>tr>th,
nz-table .ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th {
  padding: 9px 8px !important;
  border-bottom: solid 1px #b8ccd2 !important;
}

/** viewport实现高度和宽度自适应 */
.width-highly-adaptive-modal {
  // 设置动态模态框宽度
  width: 95% !important;

  .ant-modal-wrap {
    overflow-y: hidden;
  }

  .ant-modal {
    top: 0;
    width: 95% !important;
    height: 100%;
    overflow-y: hidden;
  }

  .ant-modal-content {
    top: 50px;
  }

  .ant-modal-body {
    //max-height: 73vh;
    padding: 0;
  }

  // 不定高左侧区域无限拉伸
  .as-split-area {
    max-height: 65vh;
  }

  .fixed-height-tab .ant-tabs-tabpane.ant-tabs-tabpane-active {
    min-height: 250px !important;
    max-height: 67vh !important;
    overflow-y: auto !important;
  }

  .as-horizontal {
    padding-left: 15px;
  }

  .as-split-gutter-icon {
    background: white;
  }
}
